package com.lhc.error;

public enum EmBussinessError implements CommonError {
    PARAMETER_VALIDATION_ERROR(10001,"参数不合法"),
    UNKNOWN_ERROR(10002,"未知错误"),
    USER_NOT_EXIST(20001,"用户不存在"),
    USER_VALIDATE_ERROR(20002,"手机号或密码错误"),
    USER_NOT_LOGIN(20003,"用户未登录"),
    //交易信息异常
    STOCK_NOT_ENOUGH(30001,"库存不足"),
    ;

    private EmBussinessError(int errCode,String errString){
        this.errCode = errCode;
        this.errMsg = errString;
    }

    private int errCode;
    private String errMsg;

    @Override
    public int errorCode() {
        return this.errCode;
    }

    @Override
    public String errorMessage() {
        return this.errMsg;
    }

    @Override
    public CommonError setErrorMessage(String errorMessage) {
        this.errMsg = errorMessage;
        return this;
    }

}
